﻿namespace Webinator.Performance
{
    using System;

    public class PageInfo
    {
        public PageTimings Timings { get; set; }

        public PageStatistics Statistics { get; set; }

        public string PageName { get; set; }

        public bool PageError { get; set; }

        public int PageErrorCode { get; set; }

        public int Requests { get; set; }

        public int RequestsFromCache { get; set; }

        public int RequestsNotFromCache { get; set; }

        public int SizeTotal { get; set; }

        public int SizeFromCache { get; set; }

        public int SizeWithoutCache { get; set; }

        public double SizeTotalKb
        {
            get
            {
                return Math.Round((double)SizeTotal / 1024, 1);
            }
        }

        public double SizeFromCacheKb
        {
            get
            {
                return Math.Round((double)SizeFromCache / 1024, 1);
            }
        }

        public double SizeWithoutCacheKb
        {
            get
            {
                return Math.Round((double)SizeWithoutCache / 1024, 1);
            }
        }
    }
}
